//······················· Modelo de las columnas
function mostrar_modelo(col)
{ 
    if(col==1){  	
         document.getElementById('col1').style.visibility = "visible";
		 document.getElementById('col2').style.visibility = "hidden";
		 document.getElementById('col3').style.visibility = "hidden";
		 document.getElementById('img1').src = "/media/img/widget/column1.gif";
    }

    if(col==2){	       
		 document.getElementById('col1').style.visibility = "visible";
         document.getElementById('col2').style.visibility = "visible";
		 document.getElementById('col3').style.visibility = "visible";
		 
		 document.getElementById('img1').src = "/media/img/widget/column21.gif";
         document.getElementById('img2').src = "/media/img/widget/column22.gif";
		 document.getElementById('img3').src = "/media/img/widget/column23.gif";
    }
    
    if(col==3){
	        document.getElementById('col1').style.visibility = "visible";
            document.getElementById('col2').style.visibility = "visible";
		    document.getElementById('col3').style.visibility = "hidden";
		    
		    document.getElementById('img1').src = "/media/img/widget/column31.gif";
			document.getElementById('img2').src = "/media/img/widget/column32.gif";
    }
}
//········· Editar Diseño
function mostrar_editpestanha()
{
	document.getElementById("capaFondo3").style.visibility="visible";
	document.getElementById("editarModelo").style.visibility="visible";
	document.getElementById("col").style.visibility="visible";
	document.getElementById('col1').style.visibility = "visible";
}

function ocultar_editpestanha()
{
	document.getElementById("capaFondo3").style.visibility="hidden";
	document.getElementById("editarModelo").style.visibility="hidden";
	document.getElementById("col").style.visibility="hidden";
	document.getElementById('col1').style.visibility = "hidden";
    document.getElementById('col2').style.visibility = "hidden";
	document.getElementById('col3').style.visibility = "hidden";
}

//········· Cerrar cajas de Widgets
function cerrarbox(widname,idcaja,posy)
{
	document.getElementById("cerrarcaja").style.visibility="visible";
	document.getElementById("cerrarcaja").style.top=posy + 'px';
	document.getElementById("nombrewidget").innerHTML=widname;
	document.getElementById("idbox").value = idcaja;
}

function compartirwid(widname){
	document.getElementById("id_nombre_widget").value = widname;
}

function cancelarcerrarbox()
{
    document.getElementById("cerrarcaja").style.visibility="hidden";
}

// FUNCION PARA SOLO DEJAR ESCRIBIR NUMEROS ENTEROS
var nav4b = window.Event ? true : false;
function acceptNumEnt(evt){    
// NOTE: Backspace=8, tab=9, Enter=13, '0'=48, '9'=57, comma=188, decimal point=110
var key = nav4b ? evt.which : evt.keyCode;    
return (key == 8 || key == 9 || key == 13 || (key >= 48 && key <= 57) );
}
